import { createRequest } from '/@/api/service';
const module = 'ib/equipment/v1/AssetChangeApi/';

/**
 * @function 变动审批列表查询
 * @param data
 * @param header
 * @returns
 */
function QUERY_ASSET_CHANGE_APPROVAL(
  data: AssetChangeApi.QueryAssetChangeApprovalReq,
  header: object = {},
): Promise<AssetChangeApi.QueryAssetChangeApprovalResp> {
  return createRequest(
    `${process.env.APP_API_URL}${module}queryAssetChangeApproval`,
    data,
    header,
    'POST',
  );
}

/**
 * @function 变更审批-审核统计
 * @param data
 * @param header
 * @returns
 */
function QUERY_APPROVAL_PIE(
  data: AssetChangeApi.QueryApprovalPieReq,
  header: object = {},
): Promise<AssetChangeApi.QueryApprovalPieResp> {
  return createRequest(`${process.env.APP_API_URL}${module}queryApprovalPie`, data, header, 'POST');
}

/**
 * @function 变更审批-时间分布
 * @param data
 * @param header
 * @returns
 */
function QUERY_APPROVAL_CHART_BY_TIME(
  data: AssetChangeApi.QueryApprovalChartByTimeReq,
  header: object = {},
): Promise<AssetChangeApi.QueryApprovalChartByTimeResp> {
  return createRequest(
    `${process.env.APP_API_URL}${module}queryApprovalChartByTime`,
    data,
    header,
    'POST',
  );
}

/**
 * @function 变更审批-审批结果
 * @param data
 * @param header
 * @returns
 */
function QUERY_APPROVAL_CHART_BY_STATUS(
  data: AssetChangeApi.QueryApprovalChartByStatusReq,
  header: object = {},
): Promise<AssetChangeApi.QueryApprovalChartByStatusResp> {
  return createRequest(
    `${process.env.APP_API_URL}${module}queryApprovalChartByStatus`,
    data,
    header,
    'POST',
  );
}

/**
 * @function 变更审批-审批结果
 * @param data
 * @param header
 * @returns
 */
function QUERY_CHANGE_DETAIL_BY_ASSET_ID(
  data: AssetChangeApi.ChangeDetailByAssetIdReq,
  header: object = {},
): Promise<AssetChangeApi.ChangeDetailByAssetIdResp> {
  return createRequest(
    `${process.env.APP_API_URL}${module}queryChangeDetailByAssetId`,
    data,
    header,
    'POST',
  );
}

export {
  QUERY_ASSET_CHANGE_APPROVAL,
  QUERY_APPROVAL_PIE,
  QUERY_APPROVAL_CHART_BY_TIME,
  QUERY_APPROVAL_CHART_BY_STATUS,
  QUERY_CHANGE_DETAIL_BY_ASSET_ID,
};
